
<template>
     <div class="header">
            <div v-if="show==false">
            <input type="text" v-model="name">
            <button @click="$emit('login',name);show=true">登录</button>
            </div>
            <div v-if="show">
             欢迎你：{{name}}
             <button @click="$emit('gg');show=false">退出登录</button>
             </div>
        </div>
</template>
<script>
   export default {
        data() {
            return {
                name:"",
                show:false,
            }
        }
    };
</script>